/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import java.sql.Timestamp;
import java.io.Serializable;
import java.util.Date;

/**
* @website https://el-admin.vip
* @description /
* @author zhaoxiancheng
* @date 2021-11-21
**/
@Entity
@Data
@Table(name="group_test")
public class GroupTest implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "title")
    @ApiModelProperty(value = "标题")
    private String title;

    @Column(name = "atmr_id")
    @ApiModelProperty(value = "测试类型")
    private Integer atmrId;

    @Column(name = "limit_num")
    @ApiModelProperty(value = "人数")
    private Integer limitNum;

    @Column(name = "limit_used")
    @ApiModelProperty(value = "已扫码人数")
    private Integer limitUsed;

    @Column(name = "status")
    @ApiModelProperty(value = "状态")
    private Integer status;

    @Lob
    @Basic(fetch= FetchType.LAZY)
    @Column(name = "qr_code")
    @ApiModelProperty(value = "二维码")
    private String qrCode;

    @Column(name = "validity_from")
    @ApiModelProperty(value = "有效期-开始")
    private Timestamp validityFrom;

    @Column(name = "validity_to")
    @ApiModelProperty(value = "有效期-结束")
    private Timestamp validityTo;

    @Column(name = "report_price")
    @ApiModelProperty(value = "测试报告费用")
    private String reportPrice;

    @Column(name = "price")
    @ApiModelProperty(value = "测试价格")
    private String price;

    @Column(name = "open_id")
    @ApiModelProperty(value = "锁客openId")
    private String openId;

    @Column(name = "qrcode_num")
    @ApiModelProperty(value = "二维码数量")
    private Integer qrcodeNum;

    @Column(name = "opt_type")
    @ApiModelProperty(value = "操作类型")
    private Integer optType;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @Column(name = "create_by")
    @ApiModelProperty(value = "创建者")
    private String createBy;
    @Column(name = "update_by")
    @ApiModelProperty(value = "更新者")
    private String updateBy;
    public void copy(GroupTest source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}